<?php

/**
* 控制器基类
*/
class Controller 
{
    public $data;
    public function display($template=null)
    {
        // 数组分解成变量
        extract($this->data);
        
        if($template){
            include VIEW_PATH.'/'.CONTROLLER_NAME.'/'.$template.'.html';
        }else{
            include VIEW_PATH.'/'.CONTROLLER_NAME.'/'.ACTION_NAME.'.html';
        }
    
    }

    public function assign($key,$value)
    {
        $this->data[$key]= $value;
    }
}